package com.zry.yard.ui.service

import android.app.Service
import android.content.Intent
import android.os.IBinder
import com.zry.yard.presenter.UploadImgPresenter


class UpLoadImgService : Service() {


    private var addImgList: MutableList<String>? = null
    private var operaID: String? = null
    private var uploadImgPresenter: UploadImgPresenter? = null

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        uploadImgPresenter = UploadImgPresenter(this)

        addImgList = intent?.getSerializableExtra("addImgList") as ArrayList<String>
        operaID = intent.getStringExtra("OperaID")

        addImgList!!.forEach {
            if (it != "默认图片") {
                uploadImgPresenter?.uploadFileImg( it, operaID!!)
            }
        }
        return super.onStartCommand(intent, flags, startId)
    }


    override fun onBind(intent: Intent): IBinder? {
        return null
    }
}